package com.kaibes.orm.spring;

import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Type;

import com.kaibes.orm.core.core.TableService;

@SuppressWarnings("rawtypes")
public abstract class TableInitialize<S extends TableService> {
    
    public abstract void onEmpty(S service);
    
    @SuppressWarnings("unchecked")
    public Class<S> getServiceClass() {
        Type superClass = getClass().getGenericSuperclass();
        Class<S> entityClass = (Class<S>) ((ParameterizedType) superClass).getActualTypeArguments()[0];
        return entityClass;
    }
}
